package com.ving.test.mybatis.executor;

import com.ving.test.mybatis.binding.MapperMethod;
import com.ving.test.mybatis.session.Configuration;
import com.ving.test.mybatis.statement.StatementHandler;
import com.ving.test.mybatis.util.DBUtil;

import java.sql.Connection;
import java.util.List;

/**
 * Created by liuweijie on 2019-11-14.
 */
public class SimpleExecutor implements Executor {

    private Configuration configuration;

    public SimpleExecutor() {
    }

    public SimpleExecutor(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public <T> T query(MapperMethod mapperMethod,Object parameter) throws Exception {
        System.out.println("===========");
        return new StatementHandler(configuration).query(mapperMethod,parameter);
    }
}
